const students  = require('./students')

const delFunc = (ops) => {
    const obj = JSON.parse(ops.body);
    console.log(ops);
    console.log(obj);
    //students.students.student.push(obj);
    const res = students.students.student;
    for (let i = 0; i < res.length; i++) {
        if(res[i].name === obj.name&&res[i].id===obj.id)
        {
            res.splice(i,1);
        }
    }
    return res;
};
module.exports = {
    path: '/api/del',
    type: 'post',
    func: delFunc
}